Passwordless Authentication

Passwordless Authentication is a form of authentication in CAS where passwords take the form of tokens that expire after a configurable period of time. Using this strategy, users are asked for an identifier (i.e. username) which is used to locate the user record that contains forms of contact such as email and phone number. Once located, the CAS-generated token is sent to the user via the configured notification strategies (i.e. email, sms, etc) where the user is then expected to provide the token back to CAS in order to proceed.

No Magic Link

Presently, there is no support for magic links that would remove the task of providing the token back to CAS allowing the user to proceed automagically. This variant may be worked out in future releases.

In order to successfully implement this feature, configuration needs to be in place to contact account stores that hold user records who qualify for passwordless authentication. Similarly, CAS must be configured to manage issued tokens in order to execute find, validate, expire or save operations in appropriate data stores.

Passwordless Variants

Passwordless authentication can also be activated using QR Code Authentication, allowing end users to login by scanning a QR code using a mobile device.

Passwordless authentication can also be achieved via FIDO2 WebAuthn which lets users verify their identities without passwords and login using FIDO2-enabled devices.

Overview

Support is enabled by including the following module in the overlay:

1
2
3
4
5
<dependency>
  <groupId>org.apereo.cas</groupId>
  <artifactId>cas-server-support-passwordless-webflow</artifactId>
  <version>${cas.version}</version>
</dependency>
1
implementation "org.apereo.cas:cas-server-support-passwordless-webflow:${project.'cas.version'}"
1
2
3
4
5
6
7
8
9
dependencyManagement {
  imports {
    mavenBom "org.apereo.cas:cas-server-support-bom:${project.'cas.version'}"
  }
}

dependencies {  
  implementation "org.apereo.cas:cas-server-support-passwordless-webflow"
}

The following settings and properties are available from the CAS configuration catalog:

The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

  • cas.authn.passwordless.core.delegated-authentication-selector-script.location=
  • The location of the resource. Resources can be URLS, or files found either on the classpath or outside somewhere in the file system.

    org.apereo.cas.configuration.model.SpringResourceProperties.

    The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.

  • cas.authn.passwordless.core.delegated-authentication-activated=false
  • Allow passwordless authentication to skip its own flow in favor of delegated authentication providers that may be available and defined in CAS.

    If delegated authentication is activated, CAS will skip its normal passwordless authentication flow in favor of the requested delegated authentication provider. If no delegated providers are available, passwordless authentication flow will commence as usual.

    org.apereo.cas.configuration.model.support.passwordless.PasswordlessAuthenticationCoreProperties.

  • cas.authn.passwordless.core.multifactor-authentication-activated=false
  • Allow passwordless authentication to skip its own flow in favor of multifactor authentication providers that may be available and defined in CAS.

    If multifactor authentication is activated, and defined MFA triggers in CAS signal availability and eligibility of an MFA flow for the given passwordless user, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider. If no MFA providers are available, or if no triggers require MFA for the verified passwordless user, passwordless authentication flow will commence as usual.

    org.apereo.cas.configuration.model.support.passwordless.PasswordlessAuthenticationCoreProperties.

    Configuration Metadata

    The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

    Be Selective

    This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

    YAGNI

    Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

    Naming Convention

    Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc. When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.S ettings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

    Validation

    Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

    Indexed Settings

    CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

    Account Stores

    User records that qualify for passwordless authentication must be found by CAS using one of the following strategies. All strategies may be configured using CAS settings and are activated depending on the presence of configuration values.

    Simple

    Please see this guide.

    MongoDb

    Please see this guide.

    LDAP

    Please see this guide.

    JSON

    Please see this guide.

    Groovy

    Please see this guide.

    REST

    Please see this guide.

    Custom

    Please see this guide.

    Token Management

    The following strategies define how issued tokens may be managed by CAS.

    The following settings and properties are available from the CAS configuration catalog:

    The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

  • cas.authn.passwordless.accounts.groovy.location=
  • The location of the resource. Resources can be URLS, or files found either on the classpath or outside somewhere in the file system.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationGroovyAccountsProperties.

  • cas.authn.passwordless.accounts.json.location=
  • The location of the resource. Resources can be URLS, or files found either on the classpath or outside somewhere in the file system.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationJsonAccountsProperties.

  • cas.authn.passwordless.accounts.rest.url=
  • The endpoint URL to contact and retrieve attributes.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationRestAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.client-uri=
  • The connection uri to the mongodb instance. This typically takes on the form of mongodb://user:psw@ds135522.somewhere.com:35522/db. If not specified, will fallback onto other individual settings. If specified, takes over all other settings where applicable.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.collection=
  • MongoDb database collection name to fetch and/or create.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.database-name=
  • MongoDb database instance name.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.host=localhost
  • MongoDb database host for authentication. Multiple host addresses may be defined, separated by comma. If more than one host is defined, it is assumed that each host contains the port as well, if any. Otherwise the configuration may fallback onto the port defined.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.password=
  • MongoDb database password for authentication.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.port=27017
  • MongoDb database port.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.user-id=
  • MongoDb database user for authentication.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.base-dn=
  • Base DN to use. There may be scenarios where different parts of a single LDAP tree could be considered as base-dns. Rather than duplicating the LDAP configuration block for each individual base-dn, each entry can be specified and joined together using a special delimiter character. The user DN is retrieved using the combination of all base-dn and DN resolvers in the order defined. DN resolution should fail if multiple DNs are found. Otherwise the first DN found is returned. Usual syntax is: subtreeA,dc=example,dc=net|subtreeC,dc=example,dc=net.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.bind-credential=
  • The bind credential to use when connecting to LDAP.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.bind-dn=
  • The bind DN to use when connecting to LDAP. LDAP connection configuration injected into the LDAP connection pool can be initialized with the following parameters:

    • bindDn/bindCredential provided - Use the provided credentials to bind when initializing connections.
    • bindDn/bindCredential set to * - Use a fast-bind strategy to initialize the pool.
    • bindDn/bindCredential set to blank - Skip connection initializing; perform operations anonymously.
    • SASL mechanism provided - Use the given SASL mechanism to bind when initializing connections.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.ldap-url=
  • The LDAP url to the server. More than one may be specified, separated by space and/or comma.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.search-filter=
  • User filter to use for searching. Syntax is cn={user} or cn={0}. You may also provide an external groovy script in the syntax of file:/path/to/GroovyScript.groovy to fully build the final filter template dynamically.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

    The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-name-case-change=
  • The Attribute name case change.

    org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-names=
  • The Attribute names.

    org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.attribute-value-case-change=
  • The Attribute value case change.

    org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].case-change.dn-case-change=
  • The Dn case change.

    org.apereo.cas.configuration.model.support.ldap.CaseChangeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].dn-attribute.add-if-exists=
  • The Add if exists.

    org.apereo.cas.configuration.model.support.ldap.DnAttributeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].dn-attribute.dn-attribute-name=entryDN
  • The Dn attribute name.

    org.apereo.cas.configuration.model.support.ldap.DnAttributeSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].merge-attribute.attribute-names=
  • The Attribute names.

    org.apereo.cas.configuration.model.support.ldap.MergeAttributesSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].merge-attribute.merge-attribute-name=
  • The Merge attribute name.

    org.apereo.cas.configuration.model.support.ldap.MergeAttributesSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].primary-group-id.base-dn=
  • The Base dn.

    org.apereo.cas.configuration.model.support.ldap.PrimaryGroupIdSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].primary-group-id.group-filter=(&(objectClass=group)(objectSid={0}))
  • The Group filter.

    org.apereo.cas.configuration.model.support.ldap.PrimaryGroupIdSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].recursive.merge-attributes=
  • The Merge attributes.

    org.apereo.cas.configuration.model.support.ldap.RecursiveSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].recursive.search-attribute=
  • The Search attribute.

    org.apereo.cas.configuration.model.support.ldap.RecursiveSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers[0].type=
  • The type of search entry handler to choose. Available values are as follows:

    • ACTIVE_DIRECTORY: Process the entry results fetched from active directory and check for account status controls for disabled/expired accounts, etc.
    • OBJECT_GUID: Object guid search entry handler. Handles the objectGUID attribute fetching and conversion.
    • OBJECT_SID: Object sid search entry handler. Handles the objectSid attribute fetching and conversion.
    • CASE_CHANGE: Case change search entry handler. Provides the ability to modify the case of search entry DNs, attribute names, and attribute values.
    • DN_ATTRIBUTE_ENTRY: DN attribute entry handler. Adds the entry DN as an attribute to the result set. Provides a client side implementation of RFC 5020.
    • MERGE: Merge search entry handler. Merges the values of one or more attributes into a single attribute.
    • PRIMARY_GROUP: Primary group search handler. Constructs the primary group SID and then searches for that group and puts it's DN in the memberOf attribute of the original search entry.
    • RANGE_ENTRY: Range entry search handler. Rewrites attributes returned from Active Directory to include all values by performing additional searches.
    • RECURSIVE_ENTRY: Recursive entry search handler. This recursively searches based on a supplied attribute and merges those results into the original entry.

    org.apereo.cas.configuration.model.support.ldap.LdapSearchEntryHandlersProperties.

  • cas.authn.passwordless.accounts.ldap.validator.attribute-name=objectClass
  • Attribute name to use for the compare validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.attribute-value=top
  • Attribute values to use for the compare validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.base-dn=
  • Base DN to use for the search request of the search validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.dn=
  • DN to compare to use for the compare validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.scope=OBJECT
  • Search scope to use for the search request of the search validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.search-filter=(objectClass=*)
  • Search filter to use for the search request of the search validator.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.ldap.validator.type=search
  • Determine the LDAP validator type. The following LDAP validators can be used to test connection health status:

    • search: Validates a connection is healthy by performing a search operation. Validation is considered successful if the search result size is greater than zero.
    • none: No validation takes place.
    • compare: Validates a connection is healthy by performing a compare operation.

    org.apereo.cas.configuration.model.support.ldap.LdapValidatorProperties.

  • cas.authn.passwordless.accounts.rest.basic-auth-password=
  • If REST endpoint is protected via basic authentication, specify the password for authentication.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationRestAccountsProperties.

  • cas.authn.passwordless.accounts.rest.basic-auth-username=
  • If REST endpoint is protected via basic authentication, specify the username for authentication.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationRestAccountsProperties.

  • cas.authn.passwordless.accounts.rest.headers=
  • Headers, defined as a Map, to include in the request when making the REST call. Will overwrite any header that CAS is pre-defined to send and include in the request. Key in the map should be the header name and the value in the map should be the header value.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationRestAccountsProperties.

  • cas.authn.passwordless.accounts.rest.method=GET
  • HTTP method to use when contacting the rest endpoint. Examples include GET, POST, etc.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationRestAccountsProperties.

  • cas.authn.passwordless.accounts.simple=
  • Passwordless authentication settings using static accounts. The key is the user identifier, while the value is the form of contact such as email, sms, etc.

    org.apereo.cas.configuration.model.support.passwordless.PasswordlessAuthenticationAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.pool.idle-time=PT30S
  • The maximum idle time of a pooled connection. A zero value indicates no limit to the idle time. A pooled connection that has exceeded its idle time will be closed and replaced when necessary by a new connection.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.pool.life-time=PT60S
  • The maximum time a pooled connection can live for. A zero value indicates no limit to the life time. A pooled connection that has exceeded its life time will be closed and replaced when necessary by a new connection.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.pool.max-size=10
  • Maximum number of connections to keep around.

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.pool.max-wait-time=PT60S
  • The maximum time that a thread may wait for a connection to become available.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.pool.min-size=1
  • Minimum number of connections to keep around.

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.pool.per-host=10
  • Total number of connections allowed per host.

    org.apereo.cas.configuration.model.support.mongo.MongoDbConnectionPoolProperties.

  • cas.authn.passwordless.accounts.mongo.authentication-database-name=
  • Name of the database to use for authentication.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.drop-collection=false
  • Whether collections should be dropped on startup and re-created.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.read-concern=AVAILABLE
  • Read concern. Accepted values are:

    • LOCAL
    • MAJORITY
    • LINEARIZABLE
    • SNAPSHOT
    • AVAILABLE

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.read-preference=PRIMARY
  • Read preference. Accepted values are:

    • PRIMARY
    • SECONDARY
    • SECONDARY_PREFERRED
    • PRIMARY_PREFERRED
    • NEAREST

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.replica-set=
  • A replica set in MongoDB is a group of mongod processes that maintain the same data set. Replica sets provide redundancy and high availability, and are the basis for all production deployments.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.retry-writes=false
  • Sets whether writes should be retried if they fail due to a network error.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.socket-keep-alive=false
  • Whether the database socket connection should be tagged with keep-alive.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.ssl-enabled=false
  • Whether connections require SSL.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.timeout=PT5S
  • MongoDb database connection timeout.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.mongo.write-concern=ACKNOWLEDGED
  • Write concern describes the level of acknowledgement requested from MongoDB for write operations to a standalone mongo db or to replica sets or to sharded clusters. In sharded clusters, mongo db instances will pass the write concern on to the shards.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationMongoDbAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.allow-multiple-dns=false
  • Whether search/query results are allowed to match on multiple DNs, or whether a single unique DN is expected for the result.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.allow-multiple-entries=false
  • Set if multiple Entries are allowed.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.binary-attributes=
  • Indicate the collection of attributes that are to be tagged and processed as binary attributes by the underlying search resolver.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.block-wait-time=PT3S
  • The length of time the pool will block. By default the pool will block indefinitely and there is no guarantee that waiting threads will be serviced in the order in which they made their request. This option should be used with a blocking connection pool when you need to control the exact number of connections that can be created

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.connect-timeout=PT5S
  • Sets the maximum amount of time that connects will block.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.connection-strategy=
  • If multiple URLs are provided as the ldapURL this describes how each URL will be processed.

    • ACTIVE_PASSIVE First LDAP will be used for every request unless it fails and then the next shall be used.
    • ROUND_ROBIN For each new connection the next url in the list will be used.
    • RANDOM For each new connection a random LDAP url will be selected.
    • DNS_SRV LDAP urls based on DNS SRV records of the configured/given LDAP url will be used.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.disable-pooling=false
  • Whether to use a pooled connection factory in components.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.email-attribute=mail
  • Name of the LDAP attribute that indicates the user's email address.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.fail-fast=true
  • Attempt to populate the connection pool early on startup and fail quickly if something goes wrong.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.follow-referrals=true
  • Set if search referrals should be followed.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.hostname-verifier=DEFAULT
  • Hostname verification options. Available values are as follows:

    • DEFAULT: Default option, forcing verification.
    • ANY: Skip hostname verification and allow all.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.idle-time=PT10M
  • Removes connections from the pool based on how long they have been idle in the available queue. Prunes connections that have been idle for more than the indicated amount.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.keystore=
  • Path to the keystore used for SSL connections. Typically contains SSL certificates for the LDAP server.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.keystore-password=
  • Keystore password.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.keystore-type=
  • The type of keystore. PKCS12 or JKS. If left blank, defaults to the default keystore type indicated by the underlying Java platform.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.max-pool-size=10
  • Maximum LDAP connection pool size which the pool can use to grow.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.min-pool-size=3
  • Minimum LDAP connection pool size. Size the pool should be initialized to and pruned to

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.name=
  • Name of the LDAP handler.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.page-size=0
  • Request that the server return results in batches of a specific size. See RFC 2696. This control is often used to work around server result size limits. A negative/zero value disables paged requests.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.phone-attribute=phoneNumber
  • Name of the LDAP attribute that indicates the user's phone.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.pool-passivator=BIND
  • You may receive unexpected LDAP failures, when CAS is configured to authenticate using DIRECT or AUTHENTICATED types and LDAP is locked down to not allow anonymous binds/searches. Every second attempt with a given LDAP connection from the pool would fail if it was on the same connection as a failed login attempt, and the regular connection validator would similarly fail. When a connection is returned back to a pool, it still may contain the principal and credentials from the previous attempt. Before the next bind attempt using that connection, the validator tries to validate the connection again but fails because it’s no longer trying with the configured bind credentials but with whatever user DN was used in the previous step. Given the validation failure, the connection is closed and CAS would deny access by default. Passivators attempt to reconnect to LDAP with the configured bind credentials, effectively resetting the connection to what it should be after each bind request. Furthermore if you are seeing errors in the logs that resemble a 'Operation exception encountered, reopening connection' type of message, this usually is an indication that the connection pool’s validation timeout established and created by CAS is greater than the timeout configured in the LDAP server, or more likely, in the load balancer in front of the LDAP servers. You can adjust the LDAP server session’s timeout for connections, or you can teach CAS to use a validity period that is equal or less than the LDAP server session’s timeout. Accepted values are:

    • NONE: No passivation takes place.
    • BIND: The default behavior which passivates a connection by performing a bind operation on it. This option requires the availability of bind credentials when establishing connections to LDAP.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.prune-period=PT2H
  • Removes connections from the pool based on how long they have been idle in the available queue. Run the pruning process at the indicated interval.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.response-timeout=PT5S
  • Duration of time to wait for responses.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-authorization-id=
  • SASL authorization id.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-mechanism=
  • The SASL mechanism.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-mutual-auth=
  • SASL mutual auth is enabled?

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-quality-of-protection=
  • SASL quality of protected.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-realm=
  • The SASL realm.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.sasl-security-strength=
  • SASL security strength.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.search-entry-handlers=
  • Search handlers.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.subtree-search=true
  • Whether subtree searching is allowed.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.trust-certificates=
  • Path of the trust certificates to use for the SSL connection. Ignores keystore-related settings when activated and used.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.trust-manager=
  • Trust Manager options. Trust managers are responsible for managing the trust material that is used when making LDAP trust decisions, and for deciding whether credentials presented by a peer should be accepted. Accepted values are: *

    • DEFAULT: Enable and force the default JVM trust managers.
    • ANY: Trust any client or server.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.trust-store=
  • Path to the keystore used to determine which certificates or certificate authorities should be trusted. Used when connecting to an LDAP server via LDAPS or startTLS connection. If left blank, the default truststore for the Java runtime is used.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.trust-store-password=
  • Password needed to open the truststore.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.trust-store-type=
  • The type of trust keystore that determines which certificates or certificate authorities are trusted. Types depend on underlying java platform, typically PKCS12 or JKS. If left blank, defaults to the default keystore type indicated by the underlying Java platform.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.use-start-tls=false
  • Whether TLS should be used and enabled when establishing the connection.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.validate-on-checkout=true
  • Whether connections should be validated when loaned out from the pool.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.validate-period=PT5M
  • Period at which pool should be validated.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.validate-periodically=true
  • Whether connections should be validated periodically when the pool is idle.

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

  • cas.authn.passwordless.accounts.ldap.validate-timeout=PT5S
  • Period at which validation operations may time out.

    This settings supports the java.time.Duration syntax [?].

    org.apereo.cas.configuration.model.support.passwordless.account.PasswordlessAuthenticationLdapAccountsProperties.

    LDAP Scriptable Search Filter

    LDAP search filters can point to an external Groovy script to dynamically construct the final filter template.

    The script itself may be designed as:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    
    import org.ldaptive.*
    import org.springframework.context.*
    
    def run(Object[] args) {
        def filter = (FilterTemplate) args[0]
        def parameters = (Map) args[1]
        def applicationContext = (ApplicationContext) args[2]
        def logger = args[3]
    
        logger.info("Configuring LDAP filter")
        filter.setFilter("uid=something")
    }
    

    The following parameters are passed to the script:

    Parameter Description
    filter FilterTemplate to be updated by the script and used for the LDAP query.
    parameters Map of query parameters which may be used to construct the final filter.
    applicationContext Reference to the Spring ApplicationContext reference.
    logger The object responsible for issuing log messages such as logger.info(...).

    Configuration Metadata

    The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

    Be Selective

    This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

    YAGNI

    Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

    Naming Convention

    Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc. When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.S ettings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

    Validation

    Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

    Indexed Settings

    CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

    Memory

    This is the default option where tokens are kept in memory using a cache with a configurable expiration period. Needless to say, this option is not appropriate in clustered CAS deployments inside there is not a way to synchronize and replicate tokens across CAS nodes.

    JPA

    Please see this guide.

    REST

    Please see this guide.

    Custom

    Please see this guide.

    Messaging & Notifications

    The following settings and properties are available from the CAS configuration catalog:

    The configuration settings listed below are tagged as Required in the CAS configuration metadata. This flag indicates that the presence of the setting may be needed to activate or affect the behavior of the CAS feature and generally should be reviewed, possibly owned and adjusted. If the setting is assigned a default value, you do not need to strictly put the setting in your copy of the configuration, but should review it nonetheless to make sure it matches your deployment expectations.

  • cas.authn.passwordless.tokens.mail.attribute-name=mail
  • Principal attribute name that indicates the destination email address for this message. The attribute must already be resolved and available to the CAS principal.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.from=
  • Email from address.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.subject=
  • Email subject line.

    This setting supports the Spring Expression Language.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.sms.attribute-name=phone
  • Principal attribute name that indicates the destination phone number for this SMS message. The attribute must already be resolved and available to the CAS principal.

    org.apereo.cas.configuration.model.support.sms.SmsProperties.

  • cas.authn.passwordless.tokens.sms.from=
  • The from address for the message.

    org.apereo.cas.configuration.model.support.sms.SmsProperties.

  • cas.authn.passwordless.tokens.sms.text=
  • The body of the SMS message.

    org.apereo.cas.configuration.model.support.sms.SmsProperties.

    The configuration settings listed below are tagged as Optional in the CAS configuration metadata. This flag indicates that the presence of the setting is not immediately necessary in the end-user CAS configuration, because a default value is assigned or the activation of the feature is not conditionally controlled by the setting value.

  • cas.authn.passwordless.tokens.mail.bcc=
  • Email BCC address, if any.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.cc=
  • Email CC address, if any.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.html=false
  • Indicate whether the message body should be evaluated as HTML text.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.reply-to=
  • Email Reply-To address, if any.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.text=
  • Email message body. Could be plain text or a reference to an external file that would serve as a template. If specified as a path to an external file with an extension .gtemplate, then the email message body would be processed using the Groovy template engine. The template engine uses JSP style <% %> script and <%= %> expression syntax or GString style expressions. The variable out is bound to the writer that the template is being written to.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

  • cas.authn.passwordless.tokens.mail.validate-addresses=false
  • Set whether to validate all addresses which get passed to this helper.

    org.apereo.cas.configuration.model.support.email.EmailProperties.

    The following settings may also need to be defined to describe the mail server settings:

  • spring.mail.default-encoding=UTF-8
  • Default MimeMessage encoding.

  • spring.mail.host=
  • SMTP server host. For instance, `smtp.example.com`.

  • spring.mail.jndi-name=
  • Session JNDI name. When set, takes precedence over other Session settings.

  • spring.mail.password=
  • Login password of the SMTP server.

  • spring.mail.port=
  • SMTP server port.

  • spring.mail.properties=
  • Additional JavaMail Session properties.

  • spring.mail.protocol=smtp
  • Protocol used by the SMTP server.

  • spring.mail.test-connection=false
  • Whether to test that the mail server is available on startup.

  • spring.mail.username=
  • Login user of the SMTP server.

    Configuration Metadata

    The collection of configuration properties listed in this section are automatically generated from the CAS source and components that contain the actual field definitions, types, descriptions, modules, etc. This metadata may not always be 100% accurate, or could be lacking details and sufficient explanations.

    Be Selective

    This section is meant as a guide only. Do NOT copy/paste the entire collection of settings into your CAS configuration; rather pick only the properties that you need. Do NOT enable settings unless you are certain of their purpose and do NOT copy settings into your configuration only to keep them as reference. All these ideas lead to upgrade headaches, maintenance nightmares and premature aging.

    YAGNI

    Note that for nearly ALL use cases, declaring and configuring properties listed here is sufficient. You should NOT have to explicitly massage a CAS XML/Java/etc configuration file to design an authentication handler, create attribute release policies, etc. CAS at runtime will auto-configure all required changes for you. If you are unsure about the meaning of a given CAS setting, do NOT turn it on without hesitation. Review the codebase or better yet, ask questions to clarify the intended behavior.

    Naming Convention

    Property names can be specified in very relaxed terms. For instance cas.someProperty, cas.some-property, cas.some_property are all valid names. While all forms are accepted by CAS, there are certain components (in CAS and other frameworks used) whose activation at runtime is conditional on a property value, where this property is required to have been specified in CAS configuration using kebab case. This is both true for properties that are owned by CAS as well as those that might be presented to the system via an external library or framework such as Spring Boot, etc. When possible, properties should be stored in lower-case kebab format, such as cas.property-name=value.S ettings and properties that are controlled by the CAS platform directly always begin with the prefix cas. All other settings are controlled and provided to CAS via other underlying frameworks and may have their own schemas and syntax. BE CAREFUL with the distinction. Unrecognized properties are rejected by CAS and/or frameworks upon which CAS depends. This means if you somehow misspell a property definition or fail to adhere to the dot-notation syntax and such, your setting is entirely refused by CAS and likely the feature it controls will never be activated in the way you intend.

    Validation

    Configuration properties are automatically validated on CAS startup to report issues with configuration binding, specially if defined CAS settings cannot be recognized or validated by the configuration schema. The validation process is on by default and can be skipped on startup using a special system property SKIP_CONFIG_VALIDATION that should be set to true. Additional validation processes are also handled via Configuration Metadata and property migrations applied automatically on startup by Spring Boot and family.

    Indexed Settings

    CAS settings able to accept multiple values are typically documented with an index, such as cas.some.setting[0]=value. The index [0] is meant to be incremented by the adopter to allow for distinct multiple configuration blocks.

    Users may be notified of tokens via text messages, mail, etc. To learn more about available options, please see this guide or this guide.

    Disabling Passwordless Authentication Flow

    Passwordless authentication can be disabled conditionally on a per-user basis. If the passwordless account retrieved from the account store carries a user whose requestPassword is set to true, the passwordless flow (i.e. as described above with token generation, etc) will be disabled and skipped in favor of the more usual CAS authentication flow, challenging the user for a password. Support for this behavior may depend on each individual account store implementation.

    Multifactor Authentication Integration

    Passwordless authentication can be integrated with CAS multifactor authentication providers. In this scenario, once CAS configuration is enabled to support this behavior via settings or the located passwordless user account is considered eligible for multifactor authentication, CAS will allow passwordless authentication to skip its own intended normal flow (i.e. as described above with token generation, etc) in favor of multifactor authentication providers that may be available and defined in CAS.

    This means that if multifactor authentication providers are defined and activated, and defined multifactor triggers in CAS signal availability and eligibility of an multifactor flow for the given passwordless user, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider and its flow. If no multifactor providers are available, or if no triggers require the use of multifactor authentication for the verified passwordless user, passwordless authentication flow will commence as usual.

    Delegated Authentication Integration

    Passwordless authentication can be integrated with CAS delegated authentication. In this scenario, once CAS configuration is enabled to support this behavior via settings or the located passwordless user account is considered eligible for delegated authentication, CAS will allow passwordless authentication to skip its own intended normal flow (i.e. as described above with token generation, etc) in favor of delegated authentication that may be available and defined in CAS.

    This means that if delegated authentication providers are defined and activated, CAS will skip its normal passwordless authentication flow in favor of the requested multifactor authentication provider and its flow. If no delegated identity providers are available, passwordless authentication flow will commence as usual.

    The selection of a delegated authentication identity provider for a passwordless user is handled using a script. The script may be defined as such:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    
    def run(Object[] args) {
        def passwordlessUser = args[0]
        def clients = (Set) args[1]
        def httpServletRequest = args[2]
        def logger = args[3]
        
        logger.info("Testing username $passwordlessUser")
    
        clients[0]
    }
    

    The parameters passed are as follows:

    Parameter Description
    passwordlessUser The object representing the PasswordlessUserAccount.
    clients The object representing the collection of identity provider configurations.
    httpServletRequest The object representing the http request.
    logger The object responsible for issuing log messages such as logger.info(...).

    The outcome of the script can be null to skip delegated authentication for the user, or it could a selection from the available identity providers passed into the script.